package com.chinasi.dao.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.chinasi.dao.BidExpertDao;
import com.chinasi.model.BidConsumer;
import com.chinasi.model.BidExpert;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.ExpertBasic;
import com.chinasi.model.mvo.BidAgencyMvo;
import com.chinasi.model.mvo.BidConsultMvo;
import com.chinasi.model.mvo.BidConsumerMvo;
import com.chinasi.model.mvo.BidExpertMvo;
import com.chinasi.model.mvo.BidIntegrationMvo;
import com.chinasi.model.mvo.BidSupvisionMvo;
import com.caland.framework.core.annotation.Dao;
import com.caland.framework.core.page.Pager;
import com.caland.framework.dao.ibatis.impl.MyBatisBaseDaoImpl;

@Dao
public class BidExpertDaoImpl extends MyBatisBaseDaoImpl<BidExpert, java.lang.String> implements BidExpertDao {

	private static final String SQL_PREFIX = "com.chinasi.model.BidExpert.";
	@Override
	public List<BidExpertMvo> findRelationBid(BidExpert searchBean,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationBid", searchBean, rowBounds);
	}
	@Override
	public int getRelationConsultTotalCount(ExpertBasic expert) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsultTotalCount", expert);
	}
	@Override
	public List<BidConsultMvo> findRelationConsult(ExpertBasic expert,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsult", expert, rowBounds);
	}
	@Override
	public int getRelationIntegratorTotalCount(ExpertBasic expert) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationIntegratorTotalCount", expert);
	}
	@Override
	public List<BidIntegrationMvo> findRelationIntegrator(
			ExpertBasic expert, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationIntegrator", expert, rowBounds);
	}
	@Override
	public int getRelationAgencyTotalCount(ExpertBasic expert) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationAgencyTotalCount", expert);
	}
	@Override
	public List<BidAgencyMvo> findRelationAgency(ExpertBasic expert,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationAgency", expert, rowBounds);
	}
	@Override
	public int getRelationSupervisionTotalCount(ExpertBasic expert) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationSupervisionTotalCount", expert);
	}
	@Override
	public List<BidSupvisionMvo> findRelationSupervision(
			ExpertBasic expert, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationSupervision", expert, rowBounds);
	}
	@Override
	public int getRelationConsumerTotalCount(ExpertBasic expert) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsumerTotalCount", expert);
	}
	@Override
	public List<BidConsumerMvo> findRelationConsumer(ExpertBasic expert,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsumer", expert, rowBounds);
	}
}
